package com.nbsaas.boot.controller.shop;

import com.nbsaas.boot.rest.annotations.*;
import com.nbsaas.boot.rest.response.ListResponse;
import com.nbsaas.boot.rest.response.PageResponse;
import com.nbsaas.boot.rest.response.ResponseObject;
import com.nbsaas.boot.shop.api.domain.request.ShopSearchWordRequest;
import com.nbsaas.boot.shop.api.domain.request.ShopSearchWordSearch;
import com.nbsaas.boot.shop.api.domain.response.ShopSearchWordResponse;
import com.nbsaas.boot.shop.api.domain.simple.ShopSearchWordSimple;
import com.nbsaas.boot.shop.api.apis.ShopSearchWordApi;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource;

/**
*  对外控制器
*/
@RequiresAuthentication
@RestController
@RequestMapping("/shopSearchWord")
public class ShopSearchWordController {


    @Resource
    private ShopSearchWordApi shopSearchWordApi;

    @SearchData
    @RequestMapping("/search")
    public PageResponse <ShopSearchWordSimple> search(@RequestBody ShopSearchWordSearch request) {
        return shopSearchWordApi.search(request);
    }

    @SearchData
    @RequestMapping("/list")
    public ListResponse<ShopSearchWordSimple> list(@RequestBody ShopSearchWordSearch request) {
        return shopSearchWordApi.list(request);
    }

}